// ClientConfiguration.h: interface for the ClientConfiguration class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CLIENTCONFIGURATION_H__0D2DA2F2_1187_48CA_B580_F5F508A88A33__INCLUDED_)
#define AFX_CLIENTCONFIGURATION_H__0D2DA2F2_1187_48CA_B580_F5F508A88A33__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "CommonLib\Structure.h"

#define UP_REALTIMEDATA   0x00000001
#define UP_HISTORICALDATA 0x00000002
#define UP_REPORT         0x00000004
#define UP_REPORTTEMPLET  0x00000008

class ClientConfiguration  
{
protected:
	ClientConfiguration();
	virtual ~ClientConfiguration();

public:
  enum {LAN};
  static ClientConfiguration * Instance();
  static void DeleteInstance();
  void Init();
  void Cleanup();

  CTime GetServerTime() const {return CTime::GetCurrentTime()-m_tsWithServer;}
  void SetTimeSpanWithServer(const CTimeSpan& timespan) {m_tsWithServer = timespan;}

public:
  std::string m_strRegistryEntry;
  bool m_bHideLoginDlg;           // Indicate whether initially hide the login dialogue;
  bool m_bEmbeddedMode;           // Indicate whether the MainPanel should be run as embedded mode;
  std::string m_strServerIPAddress;   // IP Address for the server;
  int m_nPort;                    // Port number used to connect to server;
  int m_nNetworkMode;             // 0:LAN;
  std::string m_strUserName;
  std::string m_strPassword;
  DWORD m_dwPermission;
  CPoint m_ptSelectDlgTopLeft;
  CPoint m_ptAlarmAnimWndTopLeft;
  Options m_Options;
  DWORD m_dwLicensePermission;

protected:
  CTimeSpan m_tsWithServer;

private:
  static ClientConfiguration * m_pInstance;
};

#endif // !defined(AFX_CLIENTCONFIGURATION_H__0D2DA2F2_1187_48CA_B580_F5F508A88A33__INCLUDED_)
